# coding:utf-8
# author    : ['王稣胤 820390693@qq.com', ]
# data      : 2020/3/26 13:20
# software  : PyCharm
# python    : '3.5.3 64bit'
# file      : food.py
"""
说明文档：

"""

from ._jsonrpcs import jsonrpc_food_v1


@jsonrpc_food_v1.method("Food.add(username=String,age=Number,sex=Boolean,lve=Array,son=Object)")
def add_v1(username, age, sex, lve, son):
    """
    POST  http://127.0.0.1:5501/rpc/v1/food
    {
        "jsonrpc": "2.0",
        "id": 188,
        "method": "Common.add",
        "params": {
            "username":"xiaohui",
            "age":33,
            "sex":false,
            "lve":["吃饭","睡觉",3,4,{"title":"aaaa"}],
            "son":{
                "username":"xiaohuihui",
                "age":12
            }
        }
    }
       """

    return "username=%s,age=%s,sex=%s,lve=%s,son=%s" % (username, age, sex, lve, son)
